﻿<%@ Page Title="Cities" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Cities.aspx.cs" Inherits="IFD2.Cities" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Country/Region" meta:resourcekey="CountryRegion"></asp:Label>
                <asp:DropDownList ID="lstCountries" runat="server" DataSourceID="SqlDataSource2" DataTextField="code" DataValueField="code" CssClass="form-control input-sm" Width="100%"></asp:DropDownList>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>

            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                SelectCommand="bll_country_get_codes" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
            </asp:SqlDataSource>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" style="min-width:900px;width:98%;" class="table-hover" >
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <Columns>
                                <asp:BoundField DataField="code" HeaderText="code" SortExpression="code"  meta:resourcekey="code" />
                                <asp:BoundField DataField="lang_name" HeaderText="lang_name" SortExpression="lang_name"  meta:resourcekey="lang_name" />
                                <%--<asp:TemplateField meta:resourcekey="name">
                                    <ItemTemplate>
                                        <%# Eval("name").ToString().TrimEnd() %>
                                    </ItemTemplate>
                                </asp:TemplateField>--%>
                                <asp:BoundField DataField="name" HeaderText="name" SortExpression="name"  meta:resourcekey="name"  />
                                <asp:BoundField DataField="timezone" HeaderText="timezone" SortExpression="timezone"  meta:resourcekey="timezone" />
                                <asp:BoundField DataField="dst_month_from" HeaderText="dst_month_from" SortExpression="dst_month_from"  meta:resourcekey="dst_month_from" />
                                <asp:BoundField DataField="dst_week_from" HeaderText="dst_week_from" SortExpression="dst_week_from"  meta:resourcekey="dst_week_from" />
                                <asp:BoundField DataField="dst_month_to" HeaderText="dst_month_to" SortExpression="dst_month_to"  meta:resourcekey="dst_month_to" />
                                <asp:BoundField DataField="dst_week_to" HeaderText="dst_week_to" SortExpression="dst_week_to"  meta:resourcekey="dst_week_to" />
                            </Columns>
                            <RowStyle BackColor="#EFF3FB" />
                            <EditRowStyle BackColor="#2461BF" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </div>

                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                        SelectCommand="bll_city_get_list_by_country" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="lstCountries" Name="country" PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </div>
            </div>
        </div>
    </div>

    </div></form>

    <%--此JS手机浏览器兼容性较差,部分手机浏览器兼容性有问题，放弃表头固定表高限高？为了使用便利，建议迁移到兼容浏览器！--%>
    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var win_height = parseInt($(window).height());
            var tab_new_height = win_height - 50 - 100;//菜单占50， 为便于操作留空100
            <%--太高的表看不到表头，且PC下找水平滚动条困难，所以所有环境下限高一屏！
            var win_width = parseInt($(window).width());--%>
            if (/*win_width<768 && */$('#<%=GridView1.ClientID %>').height() > tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>
</asp:Content>
